package com.meusdrinks.business;

import java.util.List;

import br.gov.frameworkdemoiselle.stereotype.BusinessController;
import br.gov.frameworkdemoiselle.template.DelegateCrud;

import com.meusdrinks.domain.Drink;
import com.meusdrinks.persistence.DrinkDAO;

@BusinessController
public class DrinkBC extends DelegateCrud<Drink, Long, DrinkDAO> {
	
	private static final long serialVersionUID = 1L;
	
	@Override
	public List<Drink> findAll() {
		List<Drink> drinks =  super.findAll();
		for (Drink d: drinks){
			d.setComposicao( getDelegate().findByDrink(d.getId()));
		}
		return drinks;
	}
	
}
